﻿package  {
	import com.kerry.effect.Rippler;
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.net.URLRequest;
	
	/**
	 * com.kerry.effect.Rippler 类的演示文件
	 * @author PhoenixKerry（http://blog.sina.com.cn/yyy98）
	 */
	public class RipplerDemo extends Sprite {
		private var rippler:Rippler;
		
		public function RipplerDemo() {
			var loader:Loader = new Loader();
			addChild(loader);
			loader.load(new URLRequest("../assets/lilies.jpg"));
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
		}
		
		private function onLoadComplete(e:Event):void {
			var loader:Loader = e.target.loader as Loader;
			rippler = new Rippler(loader, 20, 3);
			addEventListener(Event.ENTER_FRAME, onMouseOver);
		}
		
		private function onMouseOver(e:Event):void {
			rippler.drawRipple(mouseX, mouseY, 20, 1);
		}
		
	}
}